<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{$ts['site']['site_name']}商户管理系统</title>
<link rel="shortcut icon" href="__PUBLIC__/Images/global/favicon.gif" />
<link href="/Public/shanghu/login.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Css/global.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/Js/tbox/box_red.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	var KURLDATA = {
			changeverify : "{:U('Index://Public/verify')}",
	};
	var quickloginpath	=	'/Index/index.php/Public/login/ajx_login/yes';
</script>
<!-- 核心JS加载 -->
<script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/tbox/box.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/kim.base.util.js"></script>

<link href="__PUBLIC__/Js/jTip/css/global.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/Js/jTip/js/jtip.js" type="text/javascript"></script>

</head>
<body>

<script type="text/javascript">
$(function(){
			$('#pdesc').blur(
				function(){
					$('#p_list').fadeOut("fast");
				}
				,
				function(){
					$('#pdesc').keyup();
				}
			);
			$('#pdesc').focus( function(){ $(this).keyup(); } );
			$('#pdesc').bind("keyup",function(){
					var current_obj = $(this);
					var pdesc_ = jQuery.trim(current_obj.val());
		     		$.kajax({      
		       			ajx_rtn_type:'JSON',
		       			url:"{:U('shanghu://Public/ajxshinfo')}",      
		       			type:'post', //数据发送方式  
		       			data:{pdesc:pdesc_} ,    
		       			async: false ,//同步方式     
		       			success: function(objson){
		       					  					var html_="";
		       					    				var pbook_list = $('#p_list');
		       					    				var result = objson.data;
		       					    				if(result==null||result=='null'){
		       					    					
		       					    				}else{
				       					    			for(i=0;i<result.length;i++){
				       					    				html_ = html_+'<a style="margin-top:3px;color:#222222;" href="javascript:void(0)" rel="'+result[i].title+'" id="'+result[i].id+'">';
				       					    				if(result[i].parent_id!=0&&result[i].parent_id!='0'){
				       					    					html_ = html_+"[分]";
				       					    				}else{
				       					    					html_ = html_+"[总]";
				       					    				}
				       					    				html_ = html_+'&nbsp;&nbsp;&nbsp;&nbsp;'+result[i].title+'</a><br>';
					       					    		}
		       					    				}
				       					    		if(html_==""){
				       					    			pbook_list.fadeOut("fast");
				       					    			pbook_list.html(html_);
				       					    		}else{
				       					    			pbook_list.html(html_);
				       					    			var position = current_obj.offset();
				       					    			pbook_list.css({"top":(position.top+23)+"px","left":position.left+"px"});
				       					    			pbook_list.fadeIn("fast");
				       					    		}
				       					    		pbook_list.find('a').each( function(i, elm){
				       					    			$(elm).unbind("click");
				       					    			$(elm).bind('click',function(){
				       					    											current_obj.val($(this).attr('rel'));
				       					    											$('#pid').val($(this).attr('id'));
				       					    											pbook_list.fadeOut("fast");
				       					    						});
				       					    		});
			       					    		}
		       			});
			});
});


function dosubmit(){
	var pid = jQuery.trim($('#pid').val());
	var password = jQuery.trim($('#password').val());
	var verify = jQuery.trim($('#verify').val());
	var role = jQuery.trim($("input[name=role]:checked").val());
	var remember = jQuery.trim($('#remember').val());
	if(pid==''){k_error('请选择商户');return;}
	if(role=='admin'){
		if(password==''){ k_error('请输入密码');return; }
		//if(password.length<6){k_error('密码长度最小6位');return;}
	}
	if(verify==''){k_error('请输入验证码');return;}

	$.kajax({      
			ajx_rtn_type:'JSON',
			url:"{:U('shanghu://Public/dologin')}",      
			type:'post', //数据发送方式  
			data:{pid:pid,password:password,verify:verify,role:role,remember:remember} ,    
			async: false ,//同步方式     
			success: function(objson){
							if(objson.status==1){
								k_success(objson.msg);
								k_page_redirect(objson.data.refer_url);
							}else{
								k_error(objson.msg);
							}
			}
	});
}
</script>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr height="30px">
    <td><div class="top hidden">
    <a href="javascript:;" title="设置为浏览器首页" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('<php>echo SITE_URL;</php>/shanghu');">设为首页</a>
        
    </div></td>
  </tr>
  <tr>
    <td><div class="con">
        <div class="login">
          <div class="b_left"></div>
          <div class="input">
            <div class="logo"><img src="/Public/shanghu/images/shsys_logo.gif"></div>

			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="logTb">
              <tr>
                <th>店&nbsp;&nbsp;&nbsp;&nbsp;铺</th>
                <td width="90">
                	<input type="text" id="pdesc" class="input-border" title="录入店铺名称，选择对应店铺！"/>
                	<input type="hidden" name="pid" id="pid" />
                </td>
                <td><a href="#?width=400" class="jTip" id="tip_one" rel='sh_login_exp' name="操作说明:">如何操作?</a></td>
              </tr>
              <tr>
                <th>密&nbsp;&nbsp;&nbsp;&nbsp;码</th>
                <td width="90"><input type="password" name="password" id="password" maxlength="20" class="input-border"></td>
                <td><a href="#?width=400" class="jTip" id="tip_two" rel='sh_login_pwd' name="忘记密码:">忘记密码?</a></td>
              </tr>
              <tr> 
                <th>验证码</th>
                <td width="90">
				    <input class="input-border" name="verify" id="verify" value="" maxlength="6">
				</td>
				<td> <a href="javascript:void(0);" onclick="changeverify()" >
				    	<img src="{:U('Index://Public/verify')}" id="verifyimg" alt="验证码" title="点击重新获得验证码"/>
				   	</a> </td>
              </tr>
               <tr>
                <th>&nbsp;</th>
                <td  colspan="2" style="line-height:22px; padding-top:0px; padding-left:6px; padding-bottom:8px;">
	                <div class="Sel_Ver">
					  <input type="radio" name="role" id="role" value="admin" class="check">
	                  <label for="admin">管理员</label>
	                  &nbsp;
	                  <input type="radio" name="role" id="role" value="checker" checked class="check">
	                  <label for="admin">验证员</label>
	                  &nbsp;&nbsp;&nbsp;
	                  <input type="checkbox" name="remember" id="remember" class="check" checked>
	                  <label for="remember">下次自动登录</label>
	                 </div>
                </td>
              </tr>
              
              <tr>
                <td  colspan="3" style="line-height:22px; padding-top:0px; padding-left:6px; padding-bottom:8px;">
	                <div class="Sel_Ver" style="text-algin:center;margin:0px auto;padding-left: 115px;">
					 	<input type="button" onclick="dosubmit()" 
                  			onmouseout="this.className='login-b'" onmousedown="this.className='login-b3'" onmouseover="this.className='login-b2'" 
                  			class="login-b" value="">
	                  </div>
	                  
	          	</td>
              </tr>
              <tr>
                <td colspan="3" style=" padding-left: 0px;text-align: center;font-weight: bold;">
                	<div class="reg" style="color:#222222;">若验证员不需密码登录，密码项不需录入！</div></td>
              </tr>
            </table>
          </div>
          <div class="b_right"></div>
        </div>
      </div></td>
  </tr>
  
  <tr height="40px">
    <td>
        <div class="foot">
          <!--版权及备案-->
		    <div id="copyright">©{$ts['site']['site_name']} {$ts['site']['site_companytime']} {$ts['site']['site_companyname']} 版权所有 
				<a href="" target="_blank"><img src="__PUBLIC__/Images/global/gs_new.gif" height="28" width="23" align="absmiddle" style="vertical-align: middle;"></a> 
				{$ts['site']['site_companybeian']} | {$ts['site']['site_icp']}
			</div>
        </div>
    </td>
  </tr>
</table>

 <div id="p_list" style="border: 1px solid #C5C5C5;display:none;position: absolute; 
							border-radius: 3px 3px 3px 3px;background-color: #FAFAFA;font-weight: bold;font-size:12px; z-index: 9;line-height: 23px; margin-top: 0px; padding: 5px 10px;width:220px;text-align: left;overflow:hidden;"></div>
  
  	<!-- 提示信息 每种提示以div保存 通过id 和 处罚提示标签的rel来对应-->
	<div id="jTip_info_area" class="hidden">
		<div id="sh_login_exp">
			<div style="line-height:25px;text-align:left;">
				 <span>“店铺” 输入店铺名称，在弹出框中鼠标点击选择对应店铺名。</span>
				 <br>
				 <span>“密码” 输入对应的“管理员”或“验证员”密码。</span>
				 <br>
				 <span>“验证码” 输入验证码。点击验证码图片将重新获得验证码。</span>
				 <br>
				 <span>“管理员” 或 “验证员” 单选框用来选择登录系统的角色。</span>
				 <br>
				 <span>“附加说明” 若验证员不需密码登录，密码项不需录入！</span>
			</div>
		</div>
		<div id="sh_login_pwd">
			<div style="line-height:25px;text-align:left;">
				 <span>“验证员” 密码请联系店铺管理员进行密码重新设置。</span>
				 <br>
				 <span>“管理员” 密码可联系{$ts['site']['site_name']}客服进行密码重新设置。</span>
			</div>
		</div>
	</div>
</body>
</html>

